package com.rongcheng.fluxtest.net.requestCallback;

import com.rongcheng.fluxtest.actions.ActionsCreator;
import com.rongcheng.fluxtest.dispatcher.Dispatcher;
import com.rongcheng.fluxtest.stores.LoginStore;
import com.rongcheng.frc.androidlib.net.requestCallback.YXBaseCallBack;

/**
 * Created by FengRongCheng on 2016/6/19 18:19.
 * powered by yanxiu.com
 */
public class LoginRequestCallback extends YXBaseCallBack {
    private ActionsCreator mActionsCreator;
    private Dispatcher mDispatcher;
    private LoginStore loginStore;

    public  LoginRequestCallback(){
        initDependencies();
    }
    @Override
    public void onSuccess(String content, boolean isMock) {

        mActionsCreator.sendMessage(content);
    }

    @Override
    public void onFail(String errorMessage, boolean isMock) {

    }
    private void initDependencies() {
        mDispatcher = Dispatcher.get();
        mActionsCreator = ActionsCreator.get(mDispatcher);
        loginStore = new LoginStore();
        mDispatcher.register(loginStore);
    }
}
